<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .time-box {
            position: relative;
            display: flex;
            border-radius: 50%;
            height: 200px;
            width: 200px;
            background-image: radial-gradient(#fff 0%, #fff 50%, #e2f0f1 60%);
            align-items: center;
            justify-content: center;
        }

        .time-view {
            font-size: 40px;
        }

        .time-box>span {
            display: none;
            position: absolute;
            height: 7px;
            width: 5px;
            background-color: #8fdace;
        }
    </style>
</head>

<body>
    <div class="time-box">
        <p class="time-view"></p>
    </div>
</body>
<script>
    let spans = [];
    let timeView = document.querySelector(".time-view");

    function doInit() {
        let timeBox = document.querySelector(".time-box");
        for (let i = 1;i <= 60;i ++) {
            let span = document.createElement("span");
            timeBox.appendChild(span);
            spans.push(span);
            span.style.transform = `rotateZ(${6 * i - 93}deg) translate(80px)`;
        }
    }

    doInit();

    setInterval(() => {
        let date = new Date();
        let hour = date.getHours();
        let minutes = date.getMinutes();
        let seconds = date.getSeconds();

        let text = format(hour.toString()) + ":" + format(minutes.toString());
        timeView.innerText = text;

        spans.forEach((v,i) => {
            if (i > seconds) {
                v.style.display = "none";
            } else {
                v.style.display = "inline-block";
            }
        })
        
    },1000)

    function format(str) {
        if (!str[1]) {
            return '0' + str[0];
        }
        return str;
    }

    
</script>

</html>